﻿<Pages:UCViewerCore x:Name="uCViewerCore" x:Class="Rio.Framework.Pages.Viewer.UCViewer"
                    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
                    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
                    xmlns:telerikNavigation="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Navigation"
                    xmlns:telerikInput="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Input"
                    xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
                    xmlns:Pages="clr-namespace:Rio.Framework.Pages.Viewer"
                    xmlns:RioCommonControls="clr-namespace:Rio.Framework.Pages.Controls;assembly=Rio.Framework.Pages"
                    xmlns:sdk="http://schemas.microsoft.com/winfx/2006/xaml/presentation/sdk"
                    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" 
                    xmlns:mvvmLightCommand="clr-namespace:GalaSoft.MvvmLight.Command;assembly=GalaSoft.MvvmLight.Extras.SL4"
                    xmlns:Localization="clr-namespace:Rio.Framework.Localisation;assembly=Rio.Framework.Localisation"
                    mc:Ignorable="d"
                    d:DesignHeight="400"
                    d:DesignWidth="1024"
                    Loaded="UCViewerCore_Loaded">


    <Grid Background="White">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*"/>
                <RowDefinition Height="30" />
            </Grid.RowDefinitions>
            
            <RioCommonControls:DocumentRibbonBar x:Name="DocumentToolbar" ViewMode="Single" />

            <Pages:ViewerEditor x:Name="ImageViewer"
                                IsEditorVisible="False"
                                Grid.Row="1" 
                                HorizontalAlignment="Stretch"
                                VerticalAlignment="Stretch" />

            <TextBlock Name="TextBlockMode"
                   FontSize="16"
                   Grid.Row="1"
                   Grid.Column="0"
                   HorizontalAlignment="Center"
                   VerticalAlignment="Center"
                   FontWeight="Bold"
                   Foreground="#333333" />

            <telerik:RadToolBar x:Name="RadMenuDown"
                            HorizontalContentAlignment="Center" 
        	                Grid.Row="2"
        	                GripVisibility="Collapsed"
        	                Height="32"
        	                Margin="10,0,0,0" 
                            d:LayoutOverrides="Height" 
                            Grid.Column="1">
                
                <!--Navigation-->
                <sdk:Label x:Name="DocumentMenuLabel" 
                            Content="Document :"
        		            Margin="5,0,2,0"
        		            FontWeight="Bold" />
                
                <telerik:RadButton x:Name="FirstDocument" 
                                    ToolTipService.ToolTip="Premier document" 
                                    Command="{Binding ToolBarNavigationClickCommand, ElementName=uCViewerCore}"
                                    CommandParameter="FirstDocument" >
                    <Image Source="/Rio.Framework.Pages;component/Assets/Images/Viewer/first.png"
        		    Width="16" />
                </telerik:RadButton>

                <telerik:RadButton x:Name="PreviousDocument" 
                                    Command="{Binding ToolBarNavigationClickCommand, ElementName=uCViewerCore}" 
                                    CommandParameter="PreviousDocument" 
                                    ToolTipService.ToolTip="Document précédent">
                    <Image Source="/Rio.Framework.Pages;component/Assets/Images/Viewer/previous.png"
        		    Width="16" />
                </telerik:RadButton>

                <telerik:RadMaskedTextBox x:Name="MaskedTextBoxGetDocument" 
                                            Margin="0,1"
        		                            Mask="#/#"
                                            Width="70"
                                            ValueChanging="MaskedTextBoxGetDocument_ValueChanging"
        		                            ToolTipService.ToolTip="Document actuel">

                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="KeyDown">
                            <mvvmLightCommand:EventToCommand Command="{Binding PerformChangeDocumentCommand, ElementName=uCViewerCore}" 
                                                                PassEventArgsToCommand="True" />
                        </i:EventTrigger>
                    </i:Interaction.Triggers>

                </telerik:RadMaskedTextBox>
                
                <telerik:RadButton x:Name="NextDocument"
                                    Command="{Binding ToolBarNavigationClickCommand, ElementName=uCViewerCore}" 
                                    CommandParameter="NextDocument" 
                                    ToolTipService.ToolTip="Document suivant">
                    <Image Source="/Rio.Framework.Pages;component/Assets/Images/Viewer/next.png"
        		    Width="16" />
                </telerik:RadButton>
                <telerik:RadButton x:Name="LastDocument"
                                    Command="{Binding ToolBarNavigationClickCommand, ElementName=uCViewerCore}" 
                                    CommandParameter="LastDocument" 
                                    ToolTipService.ToolTip="Dernier document">
                    <Image Source="/Rio.Framework.Pages;component/Assets/Images/Viewer/last.png"
        		    Width="16" />
                </telerik:RadButton>

                <!--Page-->
                <telerik:RadToolBarSeparator Margin="10,2" />
                <sdk:Label x:Name="PageMenuLabel" 
                            Content="Page :"
        		            Margin="0,0,2,0"
        		            FontWeight="Bold" />

                <telerik:RadButton x:Name="FirstPage"
                                    IsEnabled="False"
                                    Command="{Binding ToolBarNavigationClickCommand, ElementName=uCViewerCore}" 
                                    CommandParameter="FirstPage"                                    
                                    ToolTipService.ToolTip="Permière page">
                    <Image Source="/Rio.Framework.Pages;component/Assets/Images/Viewer/top.png" Width="16" />
                </telerik:RadButton>
                <telerik:RadButton x:Name="PreviousPage" 
                                    IsEnabled="False"
                                    Command="{Binding ToolBarNavigationClickCommand, ElementName=uCViewerCore}" 
                                    CommandParameter="PreviousPage"  
                                    ToolTipService.ToolTip="Page précédente">
                    <Image Source="/Rio.Framework.Pages;component/Assets/Images/Viewer/up.png" Width="16" />
                </telerik:RadButton>

                <telerikInput:RadMaskedTextBox x:Name="MaskedTextBoxGetPage" 
                                                Margin="0,1"
        		                                Mask="#/#"
                                                IsEnabled="False"
                                                ValueChanging="MaskedTextBoxGetPage_ValueChanging" 
                                                ToolTipService.ToolTip="Page actuelle"  
                                                Padding="0" 
                                                MinHeight="22"
                                                MinWidth="50">

                    <i:Interaction.Triggers>
                        <i:EventTrigger EventName="KeyDown">
                            <mvvmLightCommand:EventToCommand Command="{Binding PerformChangePageCommand, ElementName=uCViewerCore}" 
                                                                PassEventArgsToCommand="True" />
                        </i:EventTrigger>
                    </i:Interaction.Triggers>

                </telerikInput:RadMaskedTextBox>

                <telerik:RadButton x:Name="NextPage"
                                    IsEnabled="False"
                                    Command="{Binding ToolBarNavigationClickCommand, ElementName=uCViewerCore}" 
                                    CommandParameter="NextPage"                                      
                                    ToolTipService.ToolTip="Page suivante">
                    <Image Source="/Rio.Framework.Pages;component/Assets/Images/Viewer/down.png" Width="16" />
                </telerik:RadButton>

                <telerik:RadButton x:Name="LastPage"
                                    IsEnabled="False"
                                    Command="{Binding ToolBarNavigationClickCommand, ElementName=uCViewerCore}" 
                                    CommandParameter="LastPage"                                      
                                    ToolTipService.ToolTip="Dernière page">
                    <Image Source="/Rio.Framework.Pages;component/Assets/Images/Viewer/bottom.png" Width="16" />
                </telerik:RadButton>

                
                <!--Fulltext search -->
                <telerik:RadToolBarSeparator Margin="10,2" />
                <sdk:Label x:Name="SearchMenuLabel" 
                            Content="{Localization:Resx ResxKey=Search}"
        		            Margin="0,0,2,0"
        		            FontWeight="Bold" />
                
                <StackPanel Orientation="Horizontal"
                                VerticalAlignment="Stretch"
                                HorizontalAlignment="Stretch">
                    
                    <telerikNavigation:RadMenuItem x:Name="SearchButton"
                                                    Header=""
                                                    IsEnabled="False"
                                                    Command="{Binding ToolBarNavigationClickCommand, ElementName=uCViewerCore}" 
                                                    CommandParameter="SearchText"     
                                                    Width="25">
                        <telerikNavigation:RadMenuItem.Icon>
                            <Image Source="/Rio.Framework.Pages;component/Assets/Images/search_page.png"
                            Width="20" />
                        </telerikNavigation:RadMenuItem.Icon>
                    </telerikNavigation:RadMenuItem>
                </StackPanel>

                <telerik:RadButton x:Name="PreviousSearchPage"
                                    IsEnabled="False"
                                    Command="{Binding ToolBarNavigationClickCommand, ElementName=uCViewerCore}" 
                                    CommandParameter="PreviousSearchPage"     
                                    ToolTipService.ToolTip="Occurence précédente">
                    <Image Source="/Rio.Framework.Pages;component/Assets/Images/Viewer/left.png" Width="20" />
                </telerik:RadButton>

                <telerikInput:RadMaskedTextBox Name="SearchInput"
                                                    MaskType="None"
                                                    Width="100" 
                                                    IsEnabled="False" 
                                                    MouseLeave="SearchInput_MouseLeave" 
                                                    KeyDown="SearchInput_KeyDown" 
                                                    Margin="0" 
                                                    MinHeight="22"
                                                    VerticalAlignment="Center" 
                                                    Padding="0" />
                
                <telerik:RadButton x:Name="NextSearchPage"
                                    IsEnabled="False"
                                    Command="{Binding ToolBarNavigationClickCommand, ElementName=uCViewerCore}" 
                                    CommandParameter="NextSearchPage"     
                                    ToolTipService.ToolTip="Occurence suivante">
                    <Image Source="/Rio.Framework.Pages;component/Assets/Images/Viewer/right.png"
        		    Width="20" />
                </telerik:RadButton>
            </telerik:RadToolBar>
            
            <RioCommonControls:DocumentContextMenu x:Name="DocumentContextMenu" ViewMode="Single"/>
        
        </Grid>
        
        <telerik:RadExpander x:Name="DocumentPrintArea" Visibility="Collapsed"
                                 Margin="0,0,0,30"
                                 ClickMode="Press"
                                 ExpandDirection="Up"
                                 HorizontalAlignment="Stretch"
                                 VerticalAlignment="Bottom"
                                 Background="#FFB7C6DA"
                                 BorderBrush="#FF616C7A"
                                 BorderThickness="2,0,2,2">
            <ContentControl x:Name="ContentControlInfoDoc"
                                HorizontalContentAlignment="Stretch"
                                VerticalContentAlignment="Stretch">
                <RioCommonControls:PrintAreaControl x:Name="PrintArea" Height="150"  />
            </ContentControl>
        </telerik:RadExpander>
    </Grid>
</Pages:UCViewerCore>
